import request from '@/utils/request'

interface QueryParams {
  pageNo: number
  pageSize: number
  type?: number  // 可选参数
}

// 查询景点列表
export const queryAttractions = (params: QueryParams) => {
  return request({
    url: '/touristAttractions/query',
    method: 'post',
    data: params
  })
}

// 获取热门景点排行
export const getHotRank = () => {
  return request({
    url: '/touristAttractions/hotRank',
    method: 'get'
  })
}

// 获取景点详情
export const getAttractionDetail = (id: string | number) => {
  return request({
    url: `/touristAttractions/${id}`,
    method: 'get'
  })
}

// 添加景点评论
export const addAttractionReview = (data: {
  attractionId: number
  comment: string
  rating: number
}) => {
  return request({
    url: '/attractionReviews/insert',
    method: 'post',
    data
  })
} 